home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-04-25 | 5.3 KB | 169 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Select.h
- // Release Version: $ ODF 1 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef SELECT_H
- #define SELECT_H
-
- // ----- Part Layer -----
-
- #ifndef FWSELECT_H
- #include "FWSelect.h"
- #endif
-
- // ----- OS Layer -----
-
- #ifndef FWRECT_H
- #include "FWRect.h"
- #endif
-
- #ifndef FWRECSHP_H
- #include "FWRecShp.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CContent;
- class FW_CGraphicContext;
- class FW_CMouseEvent;
-
- class CContainerPart;
- class CProxy;
- class CBaseContent;
- class CSelectionContent;
-
- //========================================================================================
- // class CContainerSelection
- //========================================================================================
-
- class CContainerSelection : public FW_CSelection
- {
- //----------------------------------------------------------------------------------------
- // Initialization/Destruction
- //
- public:
- FW_DECLARE_AUTO(CContainerSelection)
-
- CContainerSelection(Environment* ev, CContainerPart* part);
- virtual ~CContainerSelection();
-
- //----------------------------------------------------------------------------------------
- // Inherited API
- //
- public:
- virtual void CloseSelection(Environment* ev);
- virtual void SelectAll(Environment* ev);
- virtual FW_Boolean IsEmpty(Environment* ev) const;
- virtual void ClearSelection(Environment* ev);
-
- virtual FW_CContent* GetSelectedContent(Environment* ev);
-
- virtual ODShape* CreateSelectionShape(Environment* ev, ODFacet* facet, FW_CFrame* frame) const;
- virtual ODShape* CreateSelectionOutline(Environment* ev, ODFacet* facet, FW_CFrame* frame) const;
-
- virtual FW_Boolean IsMouseInDraggableItem(Environment* ev,
- FW_CFrame* frame,
- const FW_CMouseEvent& theMouseEvent,
- FW_Boolean inBackground);
-
- virtual void UpdateSelectionOnMouseDown(Environment* ev,
- const FW_CMouseEvent& mouseEvent,
- ODFacet* embeddedFacet,
- FW_Boolean inEmbeddedFrameBorder,
- FW_Boolean inBackground);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- CProxy* WhichHandle(Environment* ev, FW_CGraphicContext& gc, const FW_CPoint& mouse, short& whichHandle) const;
-
- void RenderSelectionHandles(Environment* ev, FW_CGraphicContext& gc);
- void RenderHandles(Environment* ev, CProxy* proxy);
- void RenderAllHandles(Environment* ev, FW_CFrame* frame);
-
- void AddToSelection(Environment* ev, CProxy* theProxy, FW_Boolean renderHandles);
- void RemoveFromSelection(Environment* ev, CProxy* theProxy, FW_Boolean renderHandles);
-
- void OffsetSelection(Environment* ev, FW_Fixed xDelta, FW_Fixed yDelta);
-
- FW_Boolean Resize(Environment* ev, const FW_CMouseEvent& theMouseEvent);
-
- void SelectWithRectangle(Environment* ev, const FW_CMouseEvent& theMouseEvent);
-
- FW_CPoint CenterSelection(Environment* ev, FW_CFrame* scopeFrame);
-
- ODShape* GetUpdateShape() const;
- void GetDragRect(FW_CRect& dragRect) const;
-
- CProxy* GetAnchorProxy() const;
-
- void CalcCache(Environment* ev);
-
- private:
- void DoAdd(Environment* ev, CProxy* proxy);
- void DoRemove(Environment* ev, CProxy* proxy);
-
- public:
- void ProxyAdded(Environment* ev, CProxy* proxy);
- void SelectContent(Environment* ev, CBaseContent* content);
- CBaseContent* GetSelectionContent(Environment* ev);
-
- void DeleteSelection(Environment* ev);
- FW_Boolean IsOKtoEdit(Environment* ev);
-
- void SelectionChanged(Environment* ev);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- CContainerPart* fContainerPart;
- FW_CRect fDragRect;
- ODShape* fUpdateShape;
- unsigned long fCount;
- CProxy* fAnchorProxy;
- short fClickedHandle;
-
- CSelectionContent* fSelectionContent;
-
- FW_CRectShape fWorkingHandle;
- CSelectionContent* fDraggedContent;
- };
-
- //========================================================================================
- // CContainerSelection Inlines
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // CContainerSelection::GetUpdateShape
- //----------------------------------------------------------------------------------------
- inline ODShape* CContainerSelection::GetUpdateShape() const
- {
- return fUpdateShape;
- }
-
- //----------------------------------------------------------------------------------------
- // CContainerSelection::GetDragRect
- //----------------------------------------------------------------------------------------
- inline void CContainerSelection::GetDragRect(FW_CRect& dragRect) const
- {
- dragRect = fDragRect;
- }
-
- //----------------------------------------------------------------------------------------
- // CContainerSelection::GetAnchorProxy
- //----------------------------------------------------------------------------------------
- inline CProxy* CContainerSelection::GetAnchorProxy() const
- {
- return fAnchorProxy;
- }
-
- #endif